package resultx

type SuccessResponse struct {
	Code uint32 `json:"code"`
	Data any    `json:"data"`
	Msg  string `json:"msg"`
}

type NullJson struct{}

func Success(data any) *SuccessResponse {
	return &SuccessResponse{200, data, "OK"}
}

type ErrorResponse struct {
	Code uint32 `json:"code"`
	Msg  string `json:"msg"`
}

func Error(code uint32, msg string) *ErrorResponse {
	return &ErrorResponse{code, msg}
}
